package com.lujieni.provider.service.impl;

import com.lujieni.shared.dto.UserDTO;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    public boolean register(UserDTO userDTO){
        return checkUserEmail(userDTO);
    }

    private boolean checkUserEmail(UserDTO userDTO){
        String regex="^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
        return userDTO.getEmail().matches(regex);
    }

}
